<div class="uk-layui-form">
	<form class="layui-form uk-form" action="/admin/role/update.html">
	  <input type="hidden" name="id" value="${roleData.id!''}">
	  <div class="layui-form-item">
	    <label class="layui-form-label">角色：</label>
	    <div class="layui-input-inline">
	      <input type="text" name="name" required lay-verify="required" value="${roleData.name!''}" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <#if models?? && models["callcenter"]?? && models["callcenter"] == true>
	  <div class="layui-form-item" id="bindext_tip">
	    <label class="layui-form-label">默认首页：</label>
	    <div class="layui-input-inline">
	        <select name="portal">
	        	<option value="">默认</option>
	        	<#if portals??>
	        	<#list portals as portal>
	        	<option value="${portal.id!''}" <#if roleData.portal == portal.id>selected="selected"</#if>>${portal.name!''}</option>
	        	</#list>
	        	</#if>
	        </select>
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">语音渠道-首页：</label>
	    <div class="layui-input-inline">
	        <select name="callcenter">
	        	<option value="">默认</option>
	        	<#list uKeFuDic[('com.dic.homepage.callcenter') + '.obtaincode'] as dic>
					<option value="${dic.id!''}" <#if roleData?? && roleData.callcenter == dic.id>selected="selected"</#if>>${dic.name!''}</option>
				</#list>
	        </select>
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <div class="layui-inline">
			<label class="layui-form-label" id="cusname" >通话详情页：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="switchcalldetail" lay-skin="switch" lay-filter="switchcalldetail" value="1" lay-text="启用|关闭" <#if roleData.switchcalldetail>checked="checked"</#if>> 
			</div>
		</div>
	  </div>
	  <div class="layui-form-item switchcalldetail" style="<#if roleData.switchcalldetail><#else>display: none;</#if>" >
	    <div class="layui-inline">
			<label class="layui-form-label" id="cusname">通话详情页-页签：</label>
			<div class="layui-input-inline">
				<select name = "calldetail"  class="calldetail" multiple lay-ignore style="width:100%;">
					
					<#list uKeFuDic[('com.dic.callcenter.detail') + '.obtaincode'] as dic>
						<option value="${dic.code!''}" <#if roleData?? && roleData.calldetail?? && roleData.calldetail?index_of(dic.code) gte 0>selected="selected"</#if>>${dic.name!''}</option>
					</#list>
					
				</select>
			</div>
		</div>
	  </div>
	  </#if>

	  <div class="layui-form-button">
	    <div class="layui-button-block">
	      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</form>
</div>
 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  form.render(); //更新全部
  
  form.on('switch(switchcalldetail)', function(data){
		if(data.elem.checked){
			$('.switchcalldetail').show();
		}else{
			$('.switchcalldetail').hide();
		}
	});
});
layui.use('element', function(){
	var element = layui.element;
});
$(".calldetail").select2();
</script>